package com.ml.service.impl;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

import com.ml.enums.EnumPayStatus;
import com.ml.message.OrderSuccessVO;
import com.ml.service.OrderFactory;
import com.ml.service.StateHandler;

@Component
public class ErrorState implements StateHandler, InitializingBean {


	@Override
	public OrderSuccessVO handler(OrderSuccessVO order) {
		// TODO 入库失败记录
		order.setState(-1);
		return order;
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		// TODO Auto-generated method stub
		OrderFactory.register(EnumPayStatus.ERROR, this);
	}

}